#include "widget.h"
#include "ui_widget.h"


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    button = new QPushButton(this);
    button->setText("按钮");
    connect(button, &QPushButton::clicked, this, &Widget::Move);
    srand(time(nullptr));
}

Widget::~Widget()
{
    delete ui;
}
void Widget::Move(){
    button->move(abs(rand())%400, abs(rand())%400);
}
